package yxy.game.pm2.module.therionHunting;

import yxy.game.pm2.bean.area.AreaBean;
import yxy.game.pm2.bean.module.AreaModule;
import yxy.game.pm2.bean.module.rank.AreaRankModule;
import yxy.game.pm2.bean.module.rank.PlayerRankModule;

/**
 * @author wrs
 * @name AreaRankTherionChallege
 * @description 本服神兽挑战排行
 * @since 2022-06-13
 */
public class AreaRankTherionChallege extends AreaRankModule {

    private int therion; //神兽类型；4青龙，5白虎，6朱雀，7玄武

    public AreaRankTherionChallege(AreaBean areaBean,int therion){
        super(areaBean);
        this.therion = therion;
        initInfo();
    }

    public int getTherion() {
        return therion;
    }

    @Override
    public String rankName() {
        return PlayerRankModule.getAllRankNames().get(17);
    }

    @Override
    protected long valuePlastic(long value) {
        return value * 100;
    }

    @Override
    protected long valueRestore(long score) {
        return score / 100;
    }

    @Override
    public int topSize() {
        return 50;
    }

    @Override
    protected String rankKey() {
        return String.format("THERION:AREA:%s:GODBEAST:%s",getAreaId(),therion,rankName());
    }

    static public AreaRankTherionChallege getRank(String playerCode,int therion){
        AreaBean areaBean = AreaModule.area(playerCode);
        return new AreaRankTherionChallege(areaBean,therion);
    }

    static public AreaRankTherionChallege getRank(AreaBean areaBean,int therion){
        return new AreaRankTherionChallege(areaBean,therion);
    }
}
